class CreateProblems < ActiveRecord::Migration
  def self.up
    create_table :problems,:primary_key => :problem_id do |t|
      t.column :contest_id, :integer, :null => false
      t.column :letter,:string,:limit => 16, :null => false
      t.column :name,:string, :null => false, :limit  => 64
      t.column :time_limit, :integer, :null => false 
      t.column :about, :text, :null => false
    end
    
#    execute "alter table problems add constraint fk_problems_contests 
#            foreign key (contest_id) references contests(contest_id)"
  end

  def self.down
    drop_table :problems
  end
end
